package edu.spec.student.model.lecture;

import edu.spec.student.model.Student;

import javax.persistence.*;

/**
 * Created by MadFrog on 2018/01/22.
 * 学生与讲座的关联
 */
@Entity
@Table(name = "t_student_lecture")
public class StudentLecture {
    private int id;
    private Student student;
    private Lecture lecture;
    /**
     * 签到状态
     * null 默认值
     * 0 未签到或者无效签到
     * 1 成功签到
     */
    private Integer signIn;
    /**
     * 签到对于的经纬度，使用定时器，晚上处理
     */
    private Float latitude;
    private Float longitude ;
    /**
     * 点赞状态
     * null 默认值，未点赞
     * 1 已经点赞
     */
    private Integer love;

    @Id
    @GeneratedValue
    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    @ManyToOne
    @JoinColumn(name = "student_id")
    public Student getStudent() {
        return student;
    }

    public void setStudent(Student student) {
        this.student = student;
    }

    @ManyToOne
    @JoinColumn(name = "lecture_id")
    public Lecture getLecture() {
        return lecture;
    }

    public void setLecture(Lecture lecture) {
        this.lecture = lecture;
    }

    @Column(name = "sign_in")
    public Integer getSignIn() {
        return signIn;
    }

    public void setSignIn(Integer signIn) {
        this.signIn = signIn;
    }

    public Float getLatitude() {
        return latitude;
    }

    public void setLatitude(Float latitude) {
        this.latitude = latitude;
    }

    public Float getLongitude() {
        return longitude;
    }

    public void setLongitude(Float longitude) {
        this.longitude = longitude;
    }

    public Integer getLove() {
        return love;
    }

    public void setLove(Integer love) {
        this.love = love;
    }

    public StudentLecture() {
    }
}
